home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19971216-19980424 / 000145_news@newsmaster….columbia.edu _Sun Feb 1 17:26:00 1998.msg < prev    next >
Internet Message Format  |  2020-01-01  |  3KB

  1. Return-Path: <news@newsmaster.cc.columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id RAA07814
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Sun, 1 Feb 1998 17:25:59 -0500 (EST)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id RAA27555
  7.     for kermit.misc@watsun; Sun, 1 Feb 1998 17:25:59 -0500 (EST)
  8. Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
  9. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  10. Newsgroups: comp.unix.sco.misc,comp.protocols.kermit.misc
  11. Subject: Re: Modem Communications
  12. Date: 1 Feb 1998 22:25:54 GMT
  13. Organization: Columbia University
  14. Lines: 54
  15. Message-ID: <6b2spi$dgi$1@apakabar.cc.columbia.edu>
  16. References: <34d4ed93.0@fiji.easyway.net>
  17. NNTP-Posting-Host: watsun.cc.columbia.edu
  18. Xref: news.columbia.edu comp.unix.sco.misc:60085 comp.protocols.kermit.misc:8328
  19.  
  20. In article <34d4ed93.0@fiji.easyway.net>, mcp <mcp@easyway.net> wrote:
  21. : Is there a way to address the modem directly from the UNIX OS without having
  22. : to load an emulation program and then typing in modem commands?  I'm
  23. : interested in being able to send a modem a list of commands directly from
  24. : the OS... maybe via a shell script.  For example, sometimes I need to reset
  25. : a modem back to certain settings after a previous program has changed them
  26. : and wiped out NVRAM.  I would idealy like to be able to run an imaginary
  27. : command like:
  28. :     "modem_reset /dev/tty1A atz at&f atS0=1 at$MB9600 at&w"
  29. : and have my modem re-init based on the given settings.
  30. : Any one know of a way to do something like this?
  31. :
  32. You can use C-Kermit 6.0.  Unlike most modem software, it gives you a choice
  33. between controlling the modem itself, or letting you do it:
  34.  
  35.   http://www.columbia.edu/kermit/ck60.html
  36.  
  37. To accomplish the above, after installing C-Kermit, you could create the
  38. following file (call it, say, modem_reset):
  39.  
  40. ---(cut here)---
  41. #!/usr/local/bin/kermit
  42. set carrier-watch off
  43. xif failure { echo Can't open device, exit 1 }
  44. set speed 19200  ; or whatever
  45. output ATQ0V1\13
  46. input 10 OK
  47. xif failure { echo Can't get modem's attention, exit 2 }
  48. output atz at&f atS0=1 at$MB9600 at&w\13
  49. input 10 OK
  50. xif success { echo OK, exit 0 }
  51. echo Error initializing modem
  52. exit 3
  53. ---(cut here)---
  54.  
  55. Then:
  56.  
  57.   chmod +x modem_reset
  58.  
  59. Then to use it:
  60.  
  61.   modem_reset -l /dev/tty1A
  62.  
  63. The "-l" option and its argument (the device name) are passed to kermit.
  64.  
  65. So you don't even need a shell script.
  66.  
  67. Obviously, you could also restructure it to let you specify the modem
  68. commands on the command line or whatever else you wanted.
  69.  
  70. - Frank